package com.parkinginfo.listviews;

import com.parkinginfo.dbhelper.Place;
import com.parkinginfo.manager.R;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.CheckedTextView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;

public class PlacesListItem extends LinearLayout {
	
	private Place myplace;
	private TextView text1;
	private TextView text2;

	public PlacesListItem(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	@Override
	protected void onFinishInflate() {
		super.onFinishInflate();
		text1 = (TextView)findViewById(R.id.place);
		text2 = (TextView)findViewById(R.id.placeaddress);
	}

	public void setPlace(Place myplace) {
		this.myplace = myplace;
		String title = new String();
		String location = new String();
		title = myplace.getName();
		location = myplace.getLocation();
		
		text1.setText(title);
		text2.setText(location);
	}

	public Place getPlace() {
		return myplace;
	}
}
